/**
 * @Date: 2022-03-08 21:03:14
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-03-09 16:06:01
 * @FilePath: \zhihuReal\controllers\homeCtl.js
 * @Description: 主页
 */
const path = require('path')
const upload = async (ctx) => {
    const file = ctx.request.files.file
    const basename = path.basename(file.path)
    return {
        url: `${ctx.origin}/uploads/${basename}`
    }
}
module.exports = {
    upload
}